<template>
  <div class="home">
    <el-container style="height: 100%">
      <el-header>
        <el-menu
            :default-active="activeIndex"
            mode="horizontal"
            router="true"
        >
          <el-menu-item index="/">首页</el-menu-item>
          <el-menu-item index="/writearticle">写文章</el-menu-item>
          <el-menu-item index="/owncenter" >个人中心</el-menu-item>
          <el-menu-item index="/message">消息</el-menu-item>
          <el-menu-item index="/notice">通知</el-menu-item>
          <el-menu-item index="/login">登录</el-menu-item>
          <el-menu-item index="/about">关于</el-menu-item>
        </el-menu>
      </el-header>
      <el-main style="padding: 5px">
        <router-view/>
      </el-main>
      <Websocket></Websocket>
    </el-container>
  </div>
</template>

<script>

// import websocket from "@/utils/websocket";
import Websocket from "@/components/Websocket";

export default {
  name: 'App',
  components: {Websocket},
  data() {
    return {
      activeIndex: '1',
    }
  },
  created() {
    // websocket.open(10);
  },
  methods: {

  }
}
</script>


<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  height: 100%;
  margin: 0px;
}

#nav {
  padding: 30px;
}

#nav a {
  font-weight: bold;
  color: #2c3e50;
}

.home,/*设置占满*/
html,
body {
  background-color: #ffffff;
  width: 100%;
  height: 100%;
  margin: 0;
}

</style>
